package oop.basicConcept;

import java.util.Arrays;

public class Person {

    //在类中直接定义的特征就是类的属性，以变量的形式存在
    String name = "张天琪";
    int age;
    String gender;

    public Person(){
        System.out.println("我是无参的构造方法");    
    }

    public Person(String name){
        System.out.println(this.name);
    }

    public Person(String name,int age,String gender){
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    //在类中定义的此类的行为就是方法，形式与主方法一样
    void speak(String language){
        System.out.println("我是人类，我可以使用"+language+"语言交流");
    }

    public String walk(int meter,String name){
        return "我是"+name+"，我可以直立行走"+meter+"米";
    }

    public void getSum(int ... i){
        System.out.println(Arrays.toString(i));
    }


    public String login(String username){
        return "用户名-登录成功";
    }

    public String login(int password){
        return "密码-登录成功";
    }

    public String login(String username,int password){
        return "用户名密码-登录成功";
    }

    public String login(int password,String username){
        return "密码用户名-登录成功";
    }

    public static void main(String[] args) {
        //通过new的形式，创建一个实例化对象
        Person p = new Person("tom");
    }

}
